package com.zhihuishu.micro.course.dao;

import com.zhihuishu.micro.course.model.CourseFolder;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 
     * Title: CourseFolderMapper.java    
     * Description: 课程资料的业务接口
     * @author  嵇鹏
     * @created 2016年7月21日 上午9:09:07
 */
public interface CourseFolderMapper {
	/**
	 * 保存课程资料
	     * @discription 
	     * @author  嵇鹏      
	     * @created 2016年7月21日 上午11:42:38     
	     * @param courseFolder
	     * @return
	 */
	void save(CourseFolder courseFolder);


	void update(CourseFolder courseFolder);

	void delete(Integer dtoId);
	void deleteMulti(List<Integer> dtoIds);

	CourseFolder detail(Integer dtoId);

	List<Integer> listIdsByCourseId(Integer courseId);
	List<CourseFolder> list(List<Integer> dtoIds);
	List<CourseFolder> findRootAndDir(@Param("courseId")Long courseId, @Param("folderName")String folderName);

    //若找到 返回所处文件夹id
    Long findFolderNameForCreate(@Param("parentId")Long parentId, @Param("folderName")String folderName);
    //若找到 返回所处文件夹id
    Long findFolderNameForUpdate(@Param("folderId")Long folderId, @Param("folderName")String folderName);
    List<String> findFolderNameLike(@Param("parentId")Long parentId, @Param("excludeId")Integer excludeId, @Param("pattern")String pattern);

    void updateMulti(@Param("list") List<Integer> dtoIds,@Param("parentId")Long parentId, @Param("privilege")Integer privilege);

    List<Integer> findDirectChildren(@Param("list")List<Integer> folderIds);

}
